#include "FourDigitalTube.h"

// 构造函数
FourDigitalTube::FourDigitalTube (int digitalPin, int analogPin) : SoftI2C_TM1650 (digitalPin, analogPin) {}

// 初始化
void FourDigitalTube::setFourDigitalTubeInit() {
    this->init();
}

// 4位数码管 [FOUR_DIGITAL_TUBE_NAME] [OPERATION_TYPE]
void FourDigitalTube::setFourDigitalTubeAllOperation(int operationType) {
    switch (operationType) {
        case 0: this->displayOn(); break;
        case 1: this->displayOff(); break;
        case 2: this->clear(); break;
    }
}

// 4位数码管 [FOUR_DIGITAL_TUBE_NAME] 显示字符串 [DISPLAY_CONTENT]
void FourDigitalTube::setFourDigitalTubeDisplayContent(String displayContent) {
    this->displayString(displayContent);
}

// 4位数码管 [FOUR_DIGITAL_TUBE_NAME] 第 [FOUR_DIGITAL_TUBE_DOT_ORDER] 个 小数点 [FOUR_DIGITAL_TUBE_DOT_OPERATION]
void FourDigitalTube::setFourDigitalTubeDotOperation(int fourDigitalTubeDotOrder, int fourDigitalTubeDotOperation) {
    this->setDot(fourDigitalTubeDotOrder, fourDigitalTubeDotOperation == 0 ? true: false);
}

// 4位数码管清屏
void FourDigitalTube::setFourDigitalTubeClear() {
    this->clear();
}